package com.hgt.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: huanggaotao
 * @Description:
 * @Date: Created in 16:13 2021/6/18
 * @Modified By:
 */
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule(){
        //随机机制
        return new RandomRule();

        //轮询
        //return new RoundRobinRule();
    }
}
